home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / net / t4b-t5b.gz / t4b-t5b
Text File  |  1997-05-01  |  95KB  |  2,433 lines

  1. Index: bind/doc/rfc/rfc2136
  2. diff -c /dev/null bind/doc/rfc/rfc2136:8.1
  3. *** /dev/null    Wed Apr 30 21:24:39 1997
  4. --- bind/doc/rfc/rfc2136    Wed Apr 30 10:27:14 1997
  5. ***************
  6. *** 0 ****
  7. --- 1,1459 ----
  8. + Network Working Group                                  P. Vixie, Editor
  9. + Request for Comments: 2136                                          ISC
  10. + Updates: 1035                                                S. Thomson
  11. + Category: Standards Track                                      Bellcore
  12. +                                                              Y. Rekhter
  13. +                                                                   Cisco
  14. +                                                                J. Bound
  15. +                                                                     DEC
  16. +                                                              April 1997
  17. +          Dynamic Updates in the Domain Name System (DNS UPDATE)
  18. + Status of this Memo
  19. +    This document specifies an Internet standards track protocol for the
  20. +    Internet community, and requests discussion and suggestions for
  21. +    improvements.  Please refer to the current edition of the "Internet
  22. +    Official Protocol Standards" (STD 1) for the standardization state
  23. +    and status of this protocol.  Distribution of this memo is unlimited.
  24. + Abstract
  25. +    The Domain Name System was originally designed to support queries of
  26. +    a statically configured database.  While the data was expected to
  27. +    change, the frequency of those changes was expected to be fairly low,
  28. +    and all updates were made as external edits to a zone's Master File.
  29. +    Using this specification of the UPDATE opcode, it is possible to add
  30. +    or delete RRs or RRsets from a specified zone.  Prerequisites are
  31. +    specified separately from update operations, and can specify a
  32. +    dependency upon either the previous existence or nonexistence of an
  33. +    RRset, or the existence of a single RR.
  34. +    UPDATE is atomic, i.e., all prerequisites must be satisfied or else
  35. +    no update operations will take place.  There are no data dependent
  36. +    error conditions defined after the prerequisites have been met.
  37. + 1 - Definitions
  38. +    This document intentionally gives more definition to the roles of
  39. +    "Master," "Slave," and "Primary Master" servers, and their
  40. +    enumeration in NS RRs, and the SOA MNAME field.  In that sense, the
  41. +    following server type definitions can be considered an addendum to
  42. +    [RFC1035], and are intended to be consistent with [RFC1996]:
  43. +       Slave           an authoritative server that uses AXFR or IXFR to
  44. +                       retrieve the zone and is named in the zone's NS
  45. +                       RRset.
  46. + Vixie, et. al.              Standards Track                     [Page 1]
  47. + RFC 2136                       DNS Update                     April 1997
  48. +       Master          an authoritative server configured to be the
  49. +                       source of AXFR or IXFR data for one or more slave
  50. +                       servers.
  51. +       Primary Master  master server at the root of the AXFR/IXFR
  52. +                       dependency graph.  The primary master is named in
  53. +                       the zone's SOA MNAME field and optionally by an NS
  54. +                       RR.  There is by definition only one primary master
  55. +                       server per zone.
  56. +    A domain name identifies a node within the domain name space tree
  57. +    structure.  Each node has a set (possibly empty) of Resource Records
  58. +    (RRs).  All RRs having the same NAME, CLASS and TYPE are called a
  59. +    Resource Record Set (RRset).
  60. +    The pseudocode used in this document is for example purposes only.
  61. +    If it is found to disagree with the text, the text shall be
  62. +    considered authoritative.  If the text is found to be ambiguous, the
  63. +    pseudocode can be used to help resolve the ambiguity.
  64. +    1.1 - Comparison Rules
  65. +    1.1.1. Two RRs are considered equal if their NAME, CLASS, TYPE,
  66. +    RDLENGTH and RDATA fields are equal.  Note that the time-to-live
  67. +    (TTL) field is explicitly excluded from the comparison.
  68. +    1.1.2. The rules for comparison of character strings in names are
  69. +    specified in [RFC1035 2.3.3].
  70. +    1.1.3. Wildcarding is disabled.  That is, a wildcard ("*") in an
  71. +    update only matches a wildcard ("*") in the zone, and vice versa.
  72. +    1.1.4. Aliasing is disabled: A CNAME in the zone matches a CNAME in
  73. +    the update, and will not otherwise be followed.  All UPDATE
  74. +    operations are done on the basis of canonical names.
  75. +    1.1.5. The following RR types cannot be appended to an RRset.  If the
  76. +    following comparison rules are met, then an attempt to add the new RR
  77. +    will result in the replacement of the previous RR:
  78. +       SOA    compare only NAME, CLASS and TYPE -- it is not possible to
  79. +              have more than one SOA per zone, even if any of the data
  80. +              fields differ.
  81. +       WKS    compare only NAME, CLASS, TYPE, ADDRESS, and PROTOCOL
  82. +              -- only one WKS RR is possible for this tuple, even if the
  83. +              services masks differ.
  84. + Vixie, et. al.              Standards Track                     [Page 2]
  85. + RFC 2136                       DNS Update                     April 1997
  86. +       CNAME  compare only NAME, CLASS, and TYPE -- it is not possible
  87. +              to have more than one CNAME RR, even if their data fields
  88. +              differ.
  89. +    1.2 - Glue RRs
  90. +    For the purpose of determining whether a domain name used in the
  91. +    UPDATE protocol is contained within a specified zone, a domain name
  92. +    is "in" a zone if it is owned by that zone's domain name.  See
  93. +    section 7.18 for details.
  94. +    1.3 - New Assigned Numbers
  95. +       CLASS = NONE (254)
  96. +       RCODE = YXDOMAIN (6)
  97. +       RCODE = YXRRSET (7)
  98. +       RCODE = NXRRSET (8)
  99. +       RCODE = NOTAUTH (9)
  100. +       RCODE = NOTZONE (10)
  101. +       Opcode = UPDATE (5)
  102. + 2 - Update Message Format
  103. +    The DNS Message Format is defined by [RFC1035 4.1].  Some extensions
  104. +    are necessary (for example, more error codes are possible under
  105. +    UPDATE than under QUERY) and some fields must be overloaded (see
  106. +    description of CLASS fields below).
  107. +    The overall format of an UPDATE message is, following [ibid]:
  108. +       +---------------------+
  109. +       |        Header       |
  110. +       +---------------------+
  111. +       |         Zone        | specifies the zone to be updated
  112. +       +---------------------+
  113. +       |     Prerequisite    | RRs or RRsets which must (not) preexist
  114. +       +---------------------+
  115. +       |        Update       | RRs or RRsets to be added or deleted
  116. +       +---------------------+
  117. +       |   Additional Data   | additional data
  118. +       +---------------------+
  119. + Vixie, et. al.              Standards Track                     [Page 3]
  120. + RFC 2136                       DNS Update                     April 1997
  121. +    The Header Section specifies that this message is an UPDATE, and
  122. +    describes the size of the other sections.  The Zone Section names the
  123. +    zone that is to be updated by this message.  The Prerequisite Section
  124. +    specifies the starting invariants (in terms of zone content) required
  125. +    for this update.  The Update Section contains the edits to be made,
  126. +    and the Additional Data Section contains data which may be necessary
  127. +    to complete, but is not part of, this update.
  128. +    2.1 - Transport Issues
  129. +    An update transaction may be carried in a UDP datagram, if the
  130. +    request fits, or in a TCP connection (at the discretion of the
  131. +    requestor).  When TCP is used, the message is in the format described
  132. +    in [RFC1035 4.2.2].
  133. +    2.2 - Message Header
  134. +    The header of the DNS Message Format is defined by [RFC 1035 4.1].
  135. +    Not all opcodes define the same set of flag bits, though as a
  136. +    practical matter most of the bits defined for QUERY (in [ibid]) are
  137. +    identically defined by the other opcodes.  UPDATE uses only one flag
  138. +    bit (QR).
  139. +    The DNS Message Format specifies record counts for its four sections
  140. +    (Question, Answer, Authority, and Additional).  UPDATE uses the same
  141. +    fields, and the same section formats, but the naming and use of these
  142. +    sections differs as shown in the following modified header, after
  143. +    [RFC1035 4.1.1]:
  144. +                                       1  1  1  1  1  1
  145. +         0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
  146. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  147. +       |                      ID                       |
  148. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  149. +       |QR|   Opcode  |          Z         |   RCODE   |
  150. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  151. +       |                    ZOCOUNT                    |
  152. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  153. +       |                    PRCOUNT                    |
  154. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  155. +       |                    UPCOUNT                    |
  156. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  157. +       |                    ADCOUNT                    |
  158. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  159. + Vixie, et. al.              Standards Track                     [Page 4]
  160. + RFC 2136                       DNS Update                     April 1997
  161. +    These fields are used as follows:
  162. +    ID      A 16-bit identifier assigned by the entity that generates any
  163. +            kind of request.  This identifier is copied in the
  164. +            corresponding reply and can be used by the requestor to match
  165. +            replies to outstanding requests, or by the server to detect
  166. +            duplicated requests from some requestor.
  167. +    QR      A one bit field that specifies whether this message is a
  168. +            request (0), or a response (1).
  169. +    Opcode  A four bit field that specifies the kind of request in this
  170. +            message.  This value is set by the originator of a request
  171. +            and copied into the response.  The Opcode value that
  172. +            identifies an UPDATE message is five (5).
  173. +    Z       Reserved for future use.  Should be zero (0) in all requests
  174. +            and responses.  A non-zero Z field should be ignored by
  175. +            implementations of this specification.
  176. +    RCODE   Response code - this four bit field is undefined in requests
  177. +            and set in responses.  The values and meanings of this field
  178. +            within responses are as follows:
  179. +               Mneumonic   Value   Description
  180. +               ------------------------------------------------------------
  181. +               NOERROR     0       No error condition.
  182. +               FORMERR     1       The name server was unable to interpret
  183. +                                   the request due to a format error.
  184. +               SERVFAIL    2       The name server encountered an internal
  185. +                                   failure while processing this request,
  186. +                                   for example an operating system error
  187. +                                   or a forwarding timeout.
  188. +               NXDOMAIN    3       Some name that ought to exist,
  189. +                                   does not exist.
  190. +               NOTIMP      4       The name server does not support
  191. +                                   the specified Opcode.
  192. +               REFUSED     5       The name server refuses to perform the
  193. +                                   specified operation for policy or
  194. +                                   security reasons.
  195. +               YXDOMAIN    6       Some name that ought not to exist,
  196. +                                   does exist.
  197. +               YXRRSET     7       Some RRset that ought not to exist,
  198. +                                   does exist.
  199. +               NXRRSET     8       Some RRset that ought to exist,
  200. +                                   does not exist.
  201. + Vixie, et. al.              Standards Track                     [Page 5]
  202. + RFC 2136                       DNS Update                     April 1997
  203. +               NOTAUTH     9       The server is not authoritative for
  204. +                                   the zone named in the Zone Section.
  205. +               NOTZONE     10      A name used in the Prerequisite or
  206. +                                   Update Section is not within the
  207. +                                   zone denoted by the Zone Section.
  208. +    ZOCOUNT The number of RRs in the Zone Section.
  209. +    PRCOUNT The number of RRs in the Prerequisite Section.
  210. +    UPCOUNT The number of RRs in the Update Section.
  211. +    ADCOUNT The number of RRs in the Additional Data Section.
  212. +    2.3 - Zone Section
  213. +    The Zone Section has the same format as that specified in [RFC1035
  214. +    4.1.2], with the fields redefined as follows:
  215. +                                       1  1  1  1  1  1
  216. +         0  1  2  3  4  5  6  7  8  9  0  1  2  3  4  5
  217. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  218. +       |                                               |
  219. +       /                     ZNAME                     /
  220. +       /                                               /
  221. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  222. +       |                     ZTYPE                     |
  223. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  224. +       |                     ZCLASS                    |
  225. +       +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
  226. +    UPDATE uses this section to denote the zone of the records being
  227. +    updated.  All records to be updated must be in the same zone, and
  228. +    therefore the Zone Section is allowed to contain exactly one record.
  229. +    The ZNAME is the zone name, the ZTYPE must be SOA, and the ZCLASS is
  230. +    the zone's class.
  231. +    2.4 - Prerequisite Section
  232. +    This section contains a set of RRset prerequisites which must be
  233. +    satisfied at the time the UPDATE packet is received by the primary
  234. +    master server.  The format of this section is as specified by
  235. +    [RFC1035 4.1.3].  There are five possible sets of semantics that can
  236. +    be expressed here, summarized as follows and then explained below.
  237. +       (1)  RRset exists (value independent).  At least one RR with a
  238. +            specified NAME and TYPE (in the zone and class specified by
  239. +            the Zone Section) must exist.
  240. + Vixie, et. al.              Standards Track                     [Page 6]
  241. + RFC 2136                       DNS Update                     April 1997
  242. +       (2)  RRset exists (value dependent).  A set of RRs with a
  243. +            specified NAME and TYPE exists and has the same members
  244. +            with the same RDATAs as the RRset specified here in this
  245. +            Section.
  246. +       (3)  RRset does not exist.  No RRs with a specified NAME and TYPE
  247. +           (in the zone and class denoted by the Zone Section) can exist.
  248. +       (4)  Name is in use.  At least one RR with a specified NAME (in
  249. +            the zone and class specified by the Zone Section) must exist.
  250. +            Note that this prerequisite is NOT satisfied by empty
  251. +            nonterminals.
  252. +       (5)  Name is not in use.  No RR of any type is owned by a
  253. +            specified NAME.  Note that this prerequisite IS satisfied by
  254. +            empty nonterminals.
  255. +    The syntax of these is as follows:
  256. +    2.4.1 - RRset Exists (Value Independent)
  257. +    At least one RR with a specified NAME and TYPE (in the zone and class
  258. +    specified in the Zone Section) must exist.
  259. +    For this prerequisite, a requestor adds to the section a single RR
  260. +    whose NAME and TYPE are equal to that of the zone RRset whose
  261. +    existence is required.  RDLENGTH is zero and RDATA is therefore
  262. +    empty.  CLASS must be specified as ANY to differentiate this
  263. +    condition from that of an actual RR whose RDLENGTH is naturally zero
  264. +    (0) (e.g., NULL).  TTL is specified as zero (0).
  265. +    2.4.2 - RRset Exists (Value Dependent)
  266. +    A set of RRs with a specified NAME and TYPE exists and has the same
  267. +    members with the same RDATAs as the RRset specified here in this
  268. +    section.  While RRset ordering is undefined and therefore not
  269. +    significant to this comparison, the sets be identical in their
  270. +    extent.
  271. +    For this prerequisite, a requestor adds to the section an entire
  272. +    RRset whose preexistence is required.  NAME and TYPE are that of the
  273. +    RRset being denoted.  CLASS is that of the zone.  TTL must be
  274. +    specified as zero (0) and is ignored when comparing RRsets for
  275. +    identity.
  276. + Vixie, et. al.              Standards Track                     [Page 7]
  277. + RFC 2136                       DNS Update                     April 1997
  278. +    2.4.3 - RRset Does Not Exist
  279. +    No RRs with a specified NAME and TYPE (in the zone and class denoted
  280. +    by the Zone Section) can exist.
  281. +    For this prerequisite, a requestor adds to the section a single RR
  282. +    whose NAME and TYPE are equal to that of the RRset whose nonexistence
  283. +    is required.  The RDLENGTH of this record is zero (0), and RDATA
  284. +    field is therefore empty.  CLASS must be specified as NONE in order
  285. +    to distinguish this condition from a valid RR whose RDLENGTH is
  286. +    naturally zero (0) (for example, the NULL RR).  TTL must be specified
  287. +    as zero (0).
  288. +    2.4.4 - Name Is In Use
  289. +    Name is in use.  At least one RR with a specified NAME (in the zone
  290. +    and class specified by the Zone Section) must exist.  Note that this
  291. +    prerequisite is NOT satisfied by empty nonterminals.
  292. +    For this prerequisite, a requestor adds to the section a single RR
  293. +    whose NAME is equal to that of the name whose ownership of an RR is
  294. +    required.  RDLENGTH is zero and RDATA is therefore empty.  CLASS must
  295. +    be specified as ANY to differentiate this condition from that of an
  296. +    actual RR whose RDLENGTH is naturally zero (0) (e.g., NULL).  TYPE
  297. +    must be specified as ANY to differentiate this case from that of an
  298. +    RRset existence test.  TTL is specified as zero (0).
  299. +    2.4.5 - Name Is Not In Use
  300. +    Name is not in use.  No RR of any type is owned by a specified NAME.
  301. +    Note that this prerequisite IS satisfied by empty nonterminals.
  302. +    For this prerequisite, a requestor adds to the section a single RR
  303. +    whose NAME is equal to that of the name whose nonownership of any RRs
  304. +    is required.  RDLENGTH is zero and RDATA is therefore empty.  CLASS
  305. +    must be specified as NONE.  TYPE must be specified as ANY.  TTL must
  306. +    be specified as zero (0).
  307. +    2.5 - Update Section
  308. +    This section contains RRs to be added to or deleted from the zone.
  309. +    The format of this section is as specified by [RFC1035 4.1.3].  There
  310. +    are four possible sets of semantics, summarized below and with
  311. +    details to follow.
  312. + Vixie, et. al.              Standards Track                     [Page 8]
  313. + RFC 2136                       DNS Update                     April 1997
  314. +       (1) Add RRs to an RRset.
  315. +       (2) Delete an RRset.
  316. +       (3) Delete all RRsets from a name.
  317. +       (4) Delete an RR from an RRset.
  318. +    The syntax of these is as follows:
  319. +    2.5.1 - Add To An RRset
  320. +    RRs are added to the Update Section whose NAME, TYPE, TTL, RDLENGTH
  321. +    and RDATA are those being added, and CLASS is the same as the zone
  322. +    class.  Any duplicate RRs will be silently ignored by the primary
  323. +    master.
  324. +    2.5.2 - Delete An RRset
  325. +    One RR is added to the Update Section whose NAME and TYPE are those
  326. +    of the RRset to be deleted.  TTL must be specified as zero (0) and is
  327. +    otherwise not used by the primary master.  CLASS must be specified as
  328. +    ANY.  RDLENGTH must be zero (0) and RDATA must therefore be empty.
  329. +    If no such RRset exists, then this Update RR will be silently ignored
  330. +    by the primary master.
  331. +    2.5.3 - Delete All RRsets From A Name
  332. +    One RR is added to the Update Section whose NAME is that of the name
  333. +    to be cleansed of RRsets.  TYPE must be specified as ANY.  TTL must
  334. +    be specified as zero (0) and is otherwise not used by the primary
  335. +    master.  CLASS must be specified as ANY.  RDLENGTH must be zero (0)
  336. +    and RDATA must therefore be empty.  If no such RRsets exist, then
  337. +    this Update RR will be silently ignored by the primary master.
  338. +    2.5.4 - Delete An RR From An RRset
  339. +    RRs to be deleted are added to the Update Section.  The NAME, TYPE,
  340. +    RDLENGTH and RDATA must match the RR being deleted.  TTL must be
  341. +    specified as zero (0) and will otherwise be ignored by the primary
  342. +    master.  CLASS must be specified as NONE to distinguish this from an
  343. +    RR addition.  If no such RRs exist, then this Update RR will be
  344. +    silently ignored by the primary master.
  345. + Vixie, et. al.              Standards Track                     [Page 9]
  346. + RFC 2136                       DNS Update                     April 1997
  347. +    2.6 - Additional Data Section
  348. +    This section contains RRs which are related to the update itself, or
  349. +    to new RRs being added by the update.  For example, out of zone glue
  350. +    (A RRs referred to by new NS RRs) should be presented here.  The
  351. +    server can use or ignore out of zone glue, at the discretion of the
  352. +    server implementor.  The format of this section is as specified by
  353. +    [RFC1035 4.1.3].
  354. + 3 - Server Behavior
  355. +    A server, upon receiving an UPDATE request, will signal NOTIMP to the
  356. +    requestor if the UPDATE opcode is not recognized or if it is
  357. +    recognized but has not been implemented.  Otherwise, processing
  358. +    continues as follows.
  359. +    3.1 - Process Zone Section
  360. +    3.1.1. The Zone Section is checked to see that there is exactly one
  361. +    RR therein and that the RR's ZTYPE is SOA, else signal FORMERR to the
  362. +    requestor.  Next, the ZNAME and ZCLASS are checked to see if the zone
  363. +    so named is one of this server's authority zones, else signal NOTAUTH
  364. +    to the requestor.  If the server is a zone slave, the request will be
  365. +    forwarded toward the primary master.
  366. +    3.1.2 - Pseudocode For Zone Section Processing
  367. +       if (zcount != 1 || ztype != SOA)
  368. +            return (FORMERR)
  369. +       if (zone_type(zname, zclass) == SLAVE)
  370. +            return forward()
  371. +       if (zone_type(zname, zclass) == MASTER)
  372. +            return update()
  373. +       return (NOTAUTH)
  374. +    Sections 3.2 through 3.8 describe the primary master's behaviour,
  375. +    whereas Section 6 describes a forwarder's behaviour.
  376. +    3.2 - Process Prerequisite Section
  377. +    Next, the Prerequisite Section is checked to see that all
  378. +    prerequisites are satisfied by the current state of the zone.  Using
  379. +    the definitions expressed in Section 1.2, if any RR's NAME is not
  380. +    within the zone specified in the Zone Section, signal NOTZONE to the
  381. +    requestor.
  382. + Vixie, et. al.              Standards Track                    [Page 10]
  383. + RFC 2136                       DNS Update                     April 1997
  384. +    3.2.1. For RRs in this section whose CLASS is ANY, test to see that
  385. +    TTL and RDLENGTH are both zero (0), else signal FORMERR to the
  386. +    requestor.  If TYPE is ANY, test to see that there is at least one RR
  387. +    in the zone whose NAME is the same as that of the Prerequisite RR,
  388. +    else signal NXDOMAIN to the requestor.  If TYPE is not ANY, test to
  389. +    see that there is at least one RR in the zone whose NAME and TYPE are
  390. +    the same as that of the Prerequisite RR, else signal NXRRSET to the
  391. +    requestor.
  392. +    3.2.2. For RRs in this section whose CLASS is NONE, test to see that
  393. +    the TTL and RDLENGTH are both zero (0), else signal FORMERR to the
  394. +    requestor.  If the TYPE is ANY, test to see that there are no RRs in
  395. +    the zone whose NAME is the same as that of the Prerequisite RR, else
  396. +    signal YXDOMAIN to the requestor.  If the TYPE is not ANY, test to
  397. +    see that there are no RRs in the zone whose NAME and TYPE are the
  398. +    same as that of the Prerequisite RR, else signal YXRRSET to the
  399. +    requestor.
  400. +    3.2.3. For RRs in this section whose CLASS is the same as the ZCLASS,
  401. +    test to see that the TTL is zero (0), else signal FORMERR to the
  402. +    requestor.  Then, build an RRset for each unique <NAME,TYPE> and
  403. +    compare each resulting RRset for set equality (same members, no more,
  404. +    no less) with RRsets in the zone.  If any Prerequisite RRset is not
  405. +    entirely and exactly matched by a zone RRset, signal NXRRSET to the
  406. +    requestor.  If any RR in this section has a CLASS other than ZCLASS
  407. +    or NONE or ANY, signal FORMERR to the requestor.
  408. +    3.2.4 - Table Of Metavalues Used In Prerequisite Section
  409. +    CLASS    TYPE     RDATA    Meaning
  410. +    ------------------------------------------------------------
  411. +    ANY      ANY      empty    Name is in use
  412. +    ANY      rrset    empty    RRset exists (value independent)
  413. +    NONE     ANY      empty    Name is not in use
  414. +    NONE     rrset    empty    RRset does not exist
  415. +    zone     rrset    rr       RRset exists (value dependent)
  416. + Vixie, et. al.              Standards Track                    [Page 11]
  417. + RFC 2136                       DNS Update                     April 1997
  418. +    3.2.5 - Pseudocode for Prerequisite Section Processing
  419. +       for rr in prerequisites
  420. +            if (rr.ttl != 0)
  421. +                 return (FORMERR)
  422. +            if (zone_of(rr.name) != ZNAME)
  423. +                 return (NOTZONE);
  424. +            if (rr.class == ANY)
  425. +                 if (rr.rdlength != 0)
  426. +                      return (FORMERR)
  427. +                 if (rr.type == ANY)
  428. +                      if (!zone_name<rr.name>)
  429. +                           return (NXDOMAIN)
  430. +                 else
  431. +                      if (!zone_rrset<rr.name, rr.type>)
  432. +                           return (NXRRSET)
  433. +            if (rr.class == NONE)
  434. +                 if (rr.rdlength != 0)
  435. +                      return (FORMERR)
  436. +                 if (rr.type == ANY)
  437. +                      if (zone_name<rr.name>)
  438. +                           return (YXDOMAIN)
  439. +                 else
  440. +                      if (zone_rrset<rr.name, rr.type>)
  441. +                           return (YXRRSET)
  442. +            if (rr.class == zclass)
  443. +                 temp<rr.name, rr.type> += rr
  444. +            else
  445. +                 return (FORMERR)
  446. +       for rrset in temp
  447. +            if (zone_rrset<rrset.name, rrset.type> != rrset)
  448. +                 return (NXRRSET)
  449. +    3.3 - Check Requestor's Permissions
  450. +    3.3.1. Next, the requestor's permission to update the RRs named in
  451. +    the Update Section may be tested in an implementation dependent
  452. +    fashion or using mechanisms specified in a subsequent Secure DNS
  453. +    Update protocol.  If the requestor does not have permission to
  454. +    perform these updates, the server may write a warning message in its
  455. +    operations log, and may either signal REFUSED to the requestor, or
  456. +    ignore the permission problem and proceed with the update.
  457. + Vixie, et. al.              Standards Track                    [Page 12]
  458. + RFC 2136                       DNS Update                     April 1997
  459. +    3.3.2. While the exact processing is implementation defined, if these
  460. +    verification activities are to be performed, this is the point in the
  461. +    server's processing where such performance should take place, since
  462. +    if a REFUSED condition is encountered after an update has been
  463. +    partially applied, it will be necessary to undo the partial update
  464. +    and restore the zone to its original state before answering the
  465. +    requestor.
  466. +    3.3.3 - Pseudocode for Permission Checking
  467. +       if (security policy exists)
  468. +            if (this update is not permitted)
  469. +                 if (local option)
  470. +                      log a message about permission problem
  471. +                 if (local option)
  472. +                      return (REFUSED)
  473. +    3.4 - Process Update Section
  474. +    Next, the Update Section is processed as follows.
  475. +    3.4.1 - Prescan
  476. +    The Update Section is parsed into RRs and each RR's CLASS is checked
  477. +    to see if it is ANY, NONE, or the same as the Zone Class, else signal
  478. +    a FORMERR to the requestor.  Using the definitions in Section 1.2,
  479. +    each RR's NAME must be in the zone specified by the Zone Section,
  480. +    else signal NOTZONE to the requestor.
  481. +    3.4.1.2. For RRs whose CLASS is not ANY, check the TYPE and if it is
  482. +    ANY, AXFR, MAILA, MAILB, or any other QUERY metatype, or any
  483. +    unrecognized type, then signal FORMERR to the requestor.  For RRs
  484. +    whose CLASS is ANY or NONE, check the TTL to see that it is zero (0),
  485. +    else signal a FORMERR to the requestor.  For any RR whose CLASS is
  486. +    ANY, check the RDLENGTH to make sure that it is zero (0) (that is,
  487. +    the RDATA field is empty), and that the TYPE is not AXFR, MAILA,
  488. +    MAILB, or any other QUERY metatype besides ANY, or any unrecognized
  489. +    type, else signal FORMERR to the requestor.
  490. + Vixie, et. al.              Standards Track                    [Page 13]
  491. + RFC 2136                       DNS Update                     April 1997
  492. +    3.4.1.3 - Pseudocode For Update Section Prescan
  493. +       [rr] for rr in updates
  494. +            if (zone_of(rr.name) != ZNAME)
  495. +                 return (NOTZONE);
  496. +            if (rr.class == zclass)
  497. +                 if (rr.type & ANY|AXFR|MAILA|MAILB)
  498. +                      return (FORMERR)
  499. +            elsif (rr.class == ANY)
  500. +                 if (rr.ttl != 0 || rr.rdlength != 0
  501. +                     || rr.type & AXFR|MAILA|MAILB)
  502. +                      return (FORMERR)
  503. +            elsif (rr.class == NONE)
  504. +                 if (rr.ttl != 0 || rr.type & ANY|AXFR|MAILA|MAILB)
  505. +                      return (FORMERR)
  506. +            else
  507. +                 return (FORMERR)
  508. +    3.4.2 - Update
  509. +    The Update Section is parsed into RRs and these RRs are processed in
  510. +    order.
  511. +    3.4.2.1. If any system failure (such as an out of memory condition,
  512. +    or a hardware error in persistent storage) occurs during the
  513. +    processing of this section, signal SERVFAIL to the requestor and undo
  514. +    all updates applied to the zone during this transaction.
  515. +    3.4.2.2. Any Update RR whose CLASS is the same as ZCLASS is added to
  516. +    the zone.  In case of duplicate RDATAs (which for SOA RRs is always
  517. +    the case, and for WKS RRs is the case if the ADDRESS and PROTOCOL
  518. +    fields both match), the Zone RR is replaced by Update RR.  If the
  519. +    TYPE is SOA and there is no Zone SOA RR, or the new SOA.SERIAL is
  520. +    lower (according to [RFC1982]) than or equal to the current Zone SOA
  521. +    RR's SOA.SERIAL, the Update RR is ignored.  In the case of a CNAME
  522. +    Update RR and a non-CNAME Zone RRset or vice versa, ignore the CNAME
  523. +    Update RR, otherwise replace the CNAME Zone RR with the CNAME Update
  524. +    RR.
  525. +    3.4.2.3. For any Update RR whose CLASS is ANY and whose TYPE is ANY,
  526. +    all Zone RRs with the same NAME are deleted, unless the NAME is the
  527. +    same as ZNAME in which case only those RRs whose TYPE is other than
  528. +    SOA or NS are deleted.  For any Update RR whose CLASS is ANY and
  529. +    whose TYPE is not ANY all Zone RRs with the same NAME and TYPE are
  530. +    deleted, unless the NAME is the same as ZNAME in which case neither
  531. +    SOA or NS RRs will be deleted.
  532. + Vixie, et. al.              Standards Track                    [Page 14]
  533. + RFC 2136                       DNS Update                     April 1997
  534. +    3.4.2.4. For any Update RR whose class is NONE, any Zone RR whose
  535. +    NAME, TYPE, RDATA and RDLENGTH are equal to the Update RR is deleted,
  536. +    unless the NAME is the same as ZNAME and either the TYPE is SOA or
  537. +    the TYPE is NS and the matching Zone RR is the only NS remaining in
  538. +    the RRset, in which case this Update RR is ignored.
  539. +    3.4.2.5. Signal NOERROR to the requestor.
  540. +    3.4.2.6 - Table Of Metavalues Used In Update Section
  541. +    CLASS    TYPE     RDATA    Meaning
  542. +    ---------------------------------------------------------
  543. +    ANY      ANY      empty    Delete all RRsets from a name
  544. +    ANY      rrset    empty    Delete an RRset
  545. +    NONE     rrset    rr       Delete an RR from an RRset
  546. +    zone     rrset    rr       Add to an RRset
  547. +    3.4.2.7 - Pseudocode For Update Section Processing
  548. +       [rr] for rr in updates
  549. +            if (rr.class == zclass)
  550. +                 if (rr.type == CNAME)
  551. +                      if (zone_rrset<rr.name, ~CNAME>)
  552. +                           next [rr]
  553. +                 elsif (zone_rrset<rr.name, CNAME>)
  554. +                      next [rr]
  555. +                 if (rr.type == SOA)
  556. +                      if (!zone_rrset<rr.name, SOA> ||
  557. +                          zone_rr<rr.name, SOA>.serial > rr.soa.serial)
  558. +                           next [rr]
  559. +                 for zrr in zone_rrset<rr.name, rr.type>
  560. +                      if (rr.type == CNAME || rr.type == SOA ||
  561. +                          (rr.type == WKS && rr.proto == zrr.proto &&
  562. +                           rr.address == zrr.address) ||
  563. +                          rr.rdata == zrr.rdata)
  564. +                           zrr = rr
  565. +                           next [rr]
  566. +                 zone_rrset<rr.name, rr.type> += rr
  567. +            elsif (rr.class == ANY)
  568. +                 if (rr.type == ANY)
  569. +                      if (rr.name == zname)
  570. +                           zone_rrset<rr.name, ~(SOA|NS)> = Nil
  571. +                      else
  572. +                           zone_rrset<rr.name, *> = Nil
  573. +                 elsif (rr.name == zname &&
  574. +                        (rr.type == SOA || rr.type == NS))
  575. +                      next [rr]
  576. +                 else
  577. + Vixie, et. al.              Standards Track                    [Page 15]
  578. + RFC 2136                       DNS Update                     April 1997
  579. +                      zone_rrset<rr.name, rr.type> = Nil
  580. +            elsif (rr.class == NONE)
  581. +                 if (rr.type == SOA)
  582. +                      next [rr]
  583. +                 if (rr.type == NS && zone_rrset<rr.name, NS> == rr)
  584. +                      next [rr]
  585. +                 zone_rr<rr.name, rr.type, rr.data> = Nil
  586. +       return (NOERROR)
  587. +    3.5 - Stability
  588. +    When a zone is modified by an UPDATE operation, the server must
  589. +    commit the change to nonvolatile storage before sending a response to
  590. +    the requestor or answering any queries or transfers for the modified
  591. +    zone.  It is reasonable for a server to store only the update records
  592. +    as long as a system reboot or power failure will cause these update
  593. +    records to be incorporated into the zone the next time the server is
  594. +    started.  It is also reasonable for the server to copy the entire
  595. +    modified zone to nonvolatile storage after each update operation,
  596. +    though this would have suboptimal performance for large zones.
  597. +    3.6 - Zone Identity
  598. +    If the zone's SOA SERIAL is changed by an update operation, that
  599. +    change must be in a positive direction (using modulo 2**32 arithmetic
  600. +    as specified by [RFC1982]).  Attempts to replace an SOA with one
  601. +    whose SERIAL is less than the current one will be silently ignored by
  602. +    the primary master server.
  603. +    If the zone's SOA's SERIAL is not changed as a result of an update
  604. +    operation, then the server shall increment it automatically before
  605. +    the SOA or any changed name or RR or RRset is included in any
  606. +    response or transfer.  The primary master server's implementor might
  607. +    choose to autoincrement the SOA SERIAL if any of the following events
  608. +    occurs:
  609. +    (1)  Each update operation.
  610. +    (2)  A name, RR or RRset in the zone has changed and has subsequently
  611. +         been visible to a DNS client since the unincremented SOA was
  612. +         visible to a DNS client, and the SOA is about to become visible
  613. +         to a DNS client.
  614. +    (3)  A configurable period of time has elapsed since the last update
  615. +         operation.  This period shall be less than or equal to one third
  616. +         of the zone refresh time, and the default shall be the lesser of
  617. +         that maximum and 300 seconds.
  618. + Vixie, et. al.              Standards Track                    [Page 16]
  619. + RFC 2136                       DNS Update                     April 1997
  620. +    (4)  A configurable number of updates has been applied since the last
  621. +         SOA change.  The default value for this configuration parameter
  622. +         shall be one hundred (100).
  623. +    It is imperative that the zone's contents and the SOA's SERIAL be
  624. +    tightly synchronized.  If the zone appears to change, the SOA must
  625. +    appear to change as well.
  626. +    3.7 - Atomicity
  627. +    During the processing of an UPDATE transaction, the server must
  628. +    ensure atomicity with respect to other (concurrent) UPDATE or QUERY
  629. +    transactions.  No two transactions can be processed concurrently if
  630. +    either depends on the final results of the other; in particular, a
  631. +    QUERY should not be able to retrieve RRsets which have been partially
  632. +    modified by a concurrent UPDATE, and an UPDATE should not be able to
  633. +    start from prerequisites that might not still hold at the completion
  634. +    of some other concurrent UPDATE.  Finally, if two UPDATE transactions
  635. +    would modify the same names, RRs or RRsets, then such UPDATE
  636. +    transactions must be serialized.
  637. +    3.8 - Response
  638. +    At the end of UPDATE processing, a response code will be known.  A
  639. +    response message is generated by copying the ID and Opcode fields
  640. +    from the request, and either copying the ZOCOUNT, PRCOUNT, UPCOUNT,
  641. +    and ADCOUNT fields and associated sections, or placing zeros (0) in
  642. +    the these "count" fields and not including any part of the original
  643. +    update.  The QR bit is set to one (1), and the response is sent back
  644. +    to the requestor.  If the requestor used UDP, then the response will
  645. +    be sent to the requestor's source UDP port.  If the requestor used
  646. +    TCP, then the response will be sent back on the requestor's open TCP
  647. +    connection.
  648. + 4 - Requestor Behaviour
  649. +    4.1. From a requestor's point of view, any authoritative server for
  650. +    the zone can appear to be able to process update requests, even
  651. +    though only the primary master server is actually able to modify the
  652. +    zone's master file.  Requestors are expected to know the name of the
  653. +    zone they intend to update and to know or be able to determine the
  654. +    name servers for that zone.
  655. + Vixie, et. al.              Standards Track                    [Page 17]
  656. + RFC 2136                       DNS Update                     April 1997
  657. +    4.2. If update ordering is desired, the requestor will need to know
  658. +    the value of the existing SOA RR.  Requestors who update the SOA RR
  659. +    must update the SOA SERIAL field in a positive direction (as defined
  660. +    by [RFC1982]) and also preserve the other SOA fields unless the
  661. +    requestor's explicit intent is to change them.  The SOA SERIAL field
  662. +    must never be set to zero (0).
  663. +    4.3. If the requestor has reasonable cause to believe that all of a
  664. +    zone's servers will be equally reachable, then it should arrange to
  665. +    try the primary master server (as given by the SOA MNAME field if
  666. +    matched by some NS NSDNAME) first to avoid unnecessary forwarding
  667. +    inside the slave servers.  (Note that the primary master will in some
  668. +    cases not be reachable by all requestors, due to firewalls or network
  669. +    partitioning.)
  670. +    4.4. Once the zone's name servers been found and possibly sorted so
  671. +    that the ones more likely to be reachable and/or support the UPDATE
  672. +    opcode are listed first, the requestor composes an UPDATE message of
  673. +    the following form and sends it to the first name server on its list:
  674. +       ID:                        (new)
  675. +       Opcode:                    UPDATE
  676. +       Zone zcount:               1
  677. +       Zone zname:                (zone name)
  678. +       Zone zclass:               (zone class)
  679. +       Zone ztype:                T_SOA
  680. +       Prerequisite Section:      (see previous text)
  681. +       Update Section:            (see previous text)
  682. +       Additional Data Section:   (empty)
  683. +    4.5. If the requestor receives a response, and the response has an
  684. +    RCODE other than SERVFAIL or NOTIMP, then the requestor returns an
  685. +    appropriate response to its caller.
  686. +    4.6. If a response is received whose RCODE is SERVFAIL or NOTIMP, or
  687. +    if no response is received within an implementation dependent timeout
  688. +    period, or if an ICMP error is received indicating that the server's
  689. +    port is unreachable, then the requestor will delete the unusable
  690. +    server from its internal name server list and try the next one,
  691. +    repeating until the name server list is empty.  If the requestor runs
  692. +    out of servers to try, an appropriate error will be returned to the
  693. +    requestor's caller.
  694. + Vixie, et. al.              Standards Track                    [Page 18]
  695. + RFC 2136                       DNS Update                     April 1997
  696. + 5 - Duplicate Detection, Ordering and Mutual Exclusion
  697. +    5.1. For correct operation, mechanisms may be needed to ensure
  698. +    idempotence, order UPDATE requests and provide mutual exclusion.  An
  699. +    UPDATE message or response might be delivered zero times, one time,
  700. +    or multiple times.  Datagram duplication is of particular interest
  701. +    since it covers the case of the so-called "replay attack" where a
  702. +    correct request is duplicated maliciously by an intruder.
  703. +    5.2. Multiple UPDATE requests or responses in transit might be
  704. +    delivered in any order, due to network topology changes or load
  705. +    balancing, or to multipath forwarding graphs wherein several slave
  706. +    servers all forward to the primary master.  In some cases, it might
  707. +    be required that the earlier update not be applied after the later
  708. +    update, where "earlier" and "later" are defined by an external time
  709. +    base visible to some set of requestors, rather than by the order of
  710. +    request receipt at the primary master.
  711. +    5.3. A requestor can ensure transaction idempotence by explicitly
  712. +    deleting some "marker RR" (rather than deleting the RRset of which it
  713. +    is a part) and then adding a new "marker RR" with a different RDATA
  714. +    field.  The Prerequisite Section should specify that the original
  715. +    "marker RR" must be present in order for this UPDATE message to be
  716. +    accepted by the server.
  717. +    5.4. If the request is duplicated by a network error, all duplicate
  718. +    requests will fail since only the first will find the original
  719. +    "marker RR" present and having its known previous value.  The
  720. +    decisions of whether to use such a "marker RR" and what RR to use are
  721. +    left up to the application programmer, though one obvious choice is
  722. +    the zone's SOA RR as described below.
  723. +    5.5. Requestors can ensure update ordering by externally
  724. +    synchronizing their use of successive values of the "marker RR."
  725. +    Mutual exclusion can be addressed as a degenerate case, in that a
  726. +    single succession of the "marker RR" is all that is needed.
  727. +    5.6. A special case where update ordering and datagram duplication
  728. +    intersect is when an RR validly changes to some new value and then
  729. +    back to its previous value.  Without a "marker RR" as described
  730. +    above, this sequence of updates can leave the zone in an undefined
  731. +    state if datagrams are duplicated.
  732. +    5.7. To achieve an atomic multitransaction "read-modify-write" cycle,
  733. +    a requestor could first retrieve the SOA RR, and build an UPDATE
  734. +    message one of whose prerequisites was the old SOA RR.  It would then
  735. +    specify updates that would delete this SOA RR and add a new one with
  736. +    an incremented SOA SERIAL, along with whatever actual prerequisites
  737. + Vixie, et. al.              Standards Track                    [Page 19]
  738. + RFC 2136                       DNS Update                     April 1997
  739. +    and updates were the object of the transaction.  If the transaction
  740. +    succeeds, the requestor knows that the RRs being changed were not
  741. +    otherwise altered by any other requestor.
  742. + 6 - Forwarding
  743. +    When a zone slave forwards an UPDATE message upward toward the zone's
  744. +    primary master server, it must allocate a new ID and prepare to enter
  745. +    the role of "forwarding server," which is a requestor with respect to
  746. +    the forward server.
  747. +    6.1. The set of forward servers will be same as the set of servers
  748. +    this zone slave would use as the source of AXFR or IXFR data.  So,
  749. +    while the original requestor might have used the zone's NS RRset to
  750. +    locate its update server, a forwarder always forwards toward its
  751. +    designated zone master servers.
  752. +    6.2. If the original requestor used TCP, then the TCP connection from
  753. +    the requestor is still open and the forwarder must use TCP to forward
  754. +    the message.  If the original requestor used UDP, the forwarder may
  755. +    use either UDP or TCP to forward the message, at the whim of the
  756. +    implementor.
  757. +    6.3. It is reasonable for forward servers to be forwarders
  758. +    themselves, if the AXFR dependency graph being followed is a deep one
  759. +    involving firewalls and multiple connectivity realms.  In most cases
  760. +    the AXFR dependency graph will be shallow and the forward server will
  761. +    be the primary master server.
  762. +    6.4. The forwarder will not respond to its requestor until it
  763. +    receives a response from its forward server.  UPDATE transactions
  764. +    involving forwarders are therefore time synchronized with respect to
  765. +    the original requestor and the primary master server.
  766. +    6.5. When there are multiple possible sources of AXFR data and
  767. +    therefore multiple possible forward servers, a forwarder will use the
  768. +    same fallback strategy with respect to connectivity or timeout errors
  769. +    that it would use when performing an AXFR.  This is implementation
  770. +    dependent.
  771. +    6.6. When a forwarder receives a response from a forward server, it
  772. +    copies this response into a new response message, assigns its
  773. +    requestor's ID to that message, and sends the response back to the
  774. +    requestor.
  775. + Vixie, et. al.              Standards Track                    [Page 20]
  776. + RFC 2136                       DNS Update                     April 1997
  777. + 7 - Design, Implementation, Operation, and Protocol Notes
  778. +    Some of the principles which guided the design of this UPDATE
  779. +    specification are as follows.  Note that these are not part of the
  780. +    formal specification and any disagreement between this section and
  781. +    any other section of this document should be resolved in favour of
  782. +    the other section.
  783. +    7.1. Using metavalues for CLASS is possible only because all RRs in
  784. +    the packet are assumed to be in the same zone, and CLASS is an
  785. +    attribute of a zone rather than of an RRset.  (It is for this reason
  786. +    that the Zone Section is not optional.)
  787. +    7.2. Since there are no data-present or data-absent errors possible
  788. +    from processing the Update Section, any necessary data-present and
  789. +    data- absent dependencies should be specified in the Prerequisite
  790. +    Section.
  791. +    7.3. The Additional Data Section can be used to supply a server with
  792. +    out of zone glue that will be needed in referrals.  For example, if
  793. +    adding a new NS RR to HOME.VIX.COM specifying a nameserver called
  794. +    NS.AU.OZ, the A RR for NS.AU.OZ can be included in the Additional
  795. +    Data Section.  Servers can use this information or ignore it, at the
  796. +    discretion of the implementor.  We discourage caching this
  797. +    information for use in subsequent DNS responses.
  798. +    7.4. The Additional Data Section might be used if some of the RRs
  799. +    later needed for Secure DNS Update are not actually zone updates, but
  800. +    rather ancillary keys or signatures not intended to be stored in the
  801. +    zone (as an update would be), yet necessary for validating the update
  802. +    operation.
  803. +    7.5. It is expected that in the absence of Secure DNS Update, a
  804. +    server will only accept updates if they come from a source address
  805. +    that has been statically configured in the server's description of a
  806. +    primary master zone.  DHCP servers would be likely candidates for
  807. +    inclusion in this statically configured list.
  808. +    7.6. It is not possible to create a zone using this protocol, since
  809. +    there is no provision for a slave server to be told who its master
  810. +    servers are.  It is expected that this protocol will be extended in
  811. +    the future to cover this case.  Therefore, at this time, the addition
  812. +    of SOA RRs is unsupported.  For similar reasons, deletion of SOA RRs
  813. +    is also unsupported.
  814. + Vixie, et. al.              Standards Track                    [Page 21]
  815. + RFC 2136                       DNS Update                     April 1997
  816. +    7.7. The prerequisite for specifying that a name own at least one RR
  817. +    differs semantically from QUERY, in that QUERY would return
  818. +    <NOERROR,ANCOUNT=0> rather than NXDOMAIN if queried for an RRset at
  819. +    this name, while UPDATE's prerequisite condition [Section 2.4.4]
  820. +    would NOT be satisfied.
  821. +    7.8. It is possible for a UDP response to be lost in transit and for
  822. +    a request to be retried due to a timeout condition.  In this case an
  823. +    UPDATE that was successful the first time it was received by the
  824. +    primary master might ultimately appear to have failed when the
  825. +    response to a duplicate request is finally received by the requestor.
  826. +    (This is because the original prerequisites may no longer be
  827. +    satisfied after the update has been applied.)  For this reason,
  828. +    requestors who require an accurate response code must use TCP.
  829. +    7.9. Because a requestor who requires an accurate response code will
  830. +    initiate their UPDATE transaction using TCP, a forwarder who receives
  831. +    a request via TCP must forward it using TCP.
  832. +    7.10. Deferral of SOA SERIAL autoincrements is made possible so that
  833. +    serial numbers can be conserved and wraparound at 2**32 can be made
  834. +    an infrequent occurance.  Visible (to DNS clients) SOA SERIALs need
  835. +    to differ if the zone differs.  Note that the Authority Section SOA
  836. +    in a QUERY response is a form of visibility, for the purposes of this
  837. +    prerequisite.
  838. +    7.11. A zone's SOA SERIAL should never be set to zero (0) due to
  839. +    interoperability problems with some older but widely installed
  840. +    implementations of DNS.  When incrementing an SOA SERIAL, if the
  841. +    result of the increment is zero (0) (as will be true when wrapping
  842. +    around 2**32), it is necessary to increment it again or set it to one
  843. +    (1).  See [RFC1982] for more detail on this subject.
  844. +    7.12. Due to the TTL minimalization necessary when caching an RRset,
  845. +    it is recommended that all TTLs in an RRset be set to the same value.
  846. +    While the DNS Message Format permits variant TTLs to exist in the
  847. +    same RRset, and this variance can exist inside a zone, such variance
  848. +    will have counterintuitive results and its use is discouraged.
  849. +    7.13. Zone cut management presents some obscure corner cases to the
  850. +    add and delete operations in the Update Section.  It is possible to
  851. +    delete an NS RR as long as it is not the last NS RR at the root of a
  852. +    zone.  If deleting all RRs from a name, SOA and NS RRs at the root of
  853. +    a zone are unaffected.  If deleting RRsets, it is not possible to
  854. +    delete either SOA or NS RRsets at the top of a zone.  An attempt to
  855. +    add an SOA will be treated as a replace operation if an SOA already
  856. +    exists, or as a no-op if the SOA would be new.
  857. + Vixie, et. al.              Standards Track                    [Page 22]
  858. + RFC 2136                       DNS Update                     April 1997
  859. +    7.14. No semantic checking is required in the primary master server
  860. +    when adding new RRs.  Therefore a requestor can cause CNAME or NS or
  861. +    any other kind of RR to be added even if their target name does not
  862. +    exist or does not have the proper RRsets to make the original RR
  863. +    useful.  Primary master servers that DO implement this kind of
  864. +    checking should take great care to avoid out-of-zone dependencies
  865. +    (whose veracity cannot be authoritatively checked) and should
  866. +    implement all such checking during the prescan phase.
  867. +    7.15. Nonterminal or wildcard CNAMEs are not well specified by
  868. +    [RFC1035] and their use will probably lead to unpredictable results.
  869. +    Their use is discouraged.
  870. +    7.16. Empty nonterminals (nodes with children but no RRs of their
  871. +    own) will cause <NOERROR,ANCOUNT=0> responses to be sent in response
  872. +    to a query of any type for that name.  There is no provision for
  873. +    empty terminal nodes -- so if all RRs of a terminal node are deleted,
  874. +    the name is no longer in use, and queries of any type for that name
  875. +    will result in an NXDOMAIN response.
  876. +    7.17. In a deep AXFR dependency graph, it has not historically been
  877. +    an error for slaves to depend mutually upon each other.  This
  878. +    configuration has been used to enable a zone to flow from the primary
  879. +    master to all slaves even though not all slaves have continuous
  880. +    connectivity to the primary master.  UPDATE's use of the AXFR
  881. +    dependency graph for forwarding prohibits this kind of dependency
  882. +    loop, since UPDATE forwarding has no loop detection analagous to the
  883. +    SOA SERIAL pretest used by AXFR.
  884. +    7.18. Previously existing names which are occluded by a new zone cut
  885. +    are still considered part of the parent zone, for the purposes of
  886. +    zone transfers, even though queries for such names will be referred
  887. +    to the new subzone's servers.  If a zone cut is removed, all parent
  888. +    zone names that were occluded by it will again become visible to
  889. +    queries.  (This is a clarification of [RFC1034].)
  890. +    7.19. If a server is authoritative for both a zone and its child,
  891. +    then queries for names at the zone cut between them will be answered
  892. +    authoritatively using only data from the child zone.  (This is a
  893. +    clarification of [RFC1034].)
  894. + Vixie, et. al.              Standards Track                    [Page 23]
  895. + RFC 2136                       DNS Update                     April 1997
  896. +    7.20. Update ordering using the SOA RR is problematic since there is
  897. +    no way to know which of a zone's NS RRs represents the primary
  898. +    master, and the zone slaves can be out of date if their SOA.REFRESH
  899. +    timers have not elapsed since the last time the zone was changed on
  900. +    the primary master.  We recommend that a zone needing ordered updates
  901. +    use only servers which implement NOTIFY (see [RFC1996]) and IXFR (see
  902. +    [RFC1995]), and that a client receiving a prerequisite error while
  903. +    attempting an ordered update simply retry after a random delay period
  904. +    to allow the zone to settle.
  905. + 8 - Security Considerations
  906. +    8.1. In the absence of [RFC2137] or equivilent technology, the
  907. +    protocol described by this document makes it possible for anyone who
  908. +    can reach an authoritative name server to alter the contents of any
  909. +    zones on that server.  This is a serious increase in vulnerability
  910. +    from the current technology.  Therefore it is very strongly
  911. +    recommended that the protocols described in this document not be used
  912. +    without [RFC2137] or other equivalently strong security measures,
  913. +    e.g. IPsec.
  914. +    8.2. A denial of service attack can be launched by flooding an update
  915. +    forwarder with TCP sessions containing updates that the primary
  916. +    master server will ultimately refuse due to permission problems.
  917. +    This arises due to the requirement that an update forwarder receiving
  918. +    a request via TCP use a synchronous TCP session for its forwarding
  919. +    operation.  The connection management mechanisms of [RFC1035 4.2.2]
  920. +    are sufficient to prevent large scale damage from such an attack, but
  921. +    not to prevent some queries from going unanswered during the attack.
  922. + Acknowledgements
  923. +    We would like to thank the IETF DNSIND working group for their input
  924. +    and assistance, in particular, Rob Austein, Randy Bush, Donald
  925. +    Eastlake, Masataka Ohta, Mark Andrews, and Robert Elz.  Special
  926. +    thanks to Bill Simpson, Ken Wallich and Bob Halley for reviewing this
  927. +    document.
  928. + Vixie, et. al.              Standards Track                    [Page 24]
  929. + RFC 2136                       DNS Update                     April 1997
  930. + References
  931. +    [RFC1035]
  932. +       Mockapetris, P., "Domain Names - Implementation and
  933. +       Specification", STD 13, RFC 1035, USC/Information Sciences
  934. +       Institute, November 1987.
  935. +    [RFC1982]
  936. +       Elz, R., "Serial Number Arithmetic", RFC 1982, University of
  937. +       Melbourne, August 1996.
  938. +    [RFC1995]
  939. +       Ohta, M., "Incremental Zone Transfer", RFC 1995, Tokyo Institute
  940. +       of Technology, August 1996.
  941. +    [RFC1996]
  942. +       Vixie, P., "A Mechanism for Prompt Notification of Zone Changes",
  943. +       RFC 1996, Internet Software Consortium, August 1996.
  944. +    [RFC2065]
  945. +       Eastlake, D., and C. Kaufman, "Domain Name System Protocol
  946. +       Security Extensions", RFC 2065, January 1997.
  947. +    [RFC2137]
  948. +       Eastlake, D., "Secure Domain Name System Dynamic Update", RFC
  949. +       2137, April 1997.
  950. + Authors' Addresses
  951. +    Yakov Rekhter
  952. +    Cisco Systems
  953. +    170 West Tasman Drive
  954. +    San Jose, CA 95134-1706
  955. +    Phone: +1 914 528 0090
  956. +    EMail: yakov@cisco.com
  957. +    Susan Thomson
  958. +    Bellcore
  959. +    445 South Street
  960. +    Morristown, NJ 07960
  961. +    Phone: +1 201 829 4514
  962. +    EMail: set@thumper.bellcore.com
  963. + Vixie, et. al.              Standards Track                    [Page 25]
  964. + RFC 2136                       DNS Update                     April 1997
  965. +    Jim Bound
  966. +    Digital Equipment Corp.
  967. +    110 Spitbrook Rd ZK3-3/U14
  968. +    Nashua, NH 03062-2698
  969. +    Phone: +1 603 881 0400
  970. +    EMail: bound@zk3.dec.com
  971. +    Paul Vixie
  972. +    Internet Software Consortium
  973. +    Star Route Box 159A
  974. +    Woodside, CA 94062
  975. +    Phone: +1 415 747 0204
  976. +    EMail: paul@vix.com
  977. + Vixie, et. al.              Standards Track                    [Page 26]
  978. Index: bind/doc/rfc/rfc2137
  979. diff -c /dev/null bind/doc/rfc/rfc2137:8.1
  980. *** /dev/null    Wed Apr 30 21:24:39 1997
  981. --- bind/doc/rfc/rfc2137    Wed Apr 30 10:27:15 1997
  982. ***************
  983. *** 0 ****
  984. --- 1,619 ----
  985. + Network Working Group                                    D. Eastlake 3rd
  986. + Request for Comments: 2137                               CyberCash, Inc.
  987. + Updates: 1035                                                 April 1997
  988. + Category: Standards Track
  989. +                 Secure Domain Name System Dynamic Update
  990. + Status of this Memo
  991. +    This document specifies an Internet standards track protocol for the
  992. +    Internet community, and requests discussion and suggestions for
  993. +    improvements.  Please refer to the current edition of the "Internet
  994. +    Official Protocol Standards" (STD 1) for the standardization state
  995. +    and status of this protocol.  Distribution of this memo is unlimited.
  996. + Abstract
  997. +    Domain Name System (DNS) protocol extensions have been defined to
  998. +    authenticate the data in DNS and provide key distribution services
  999. +    [RFC2065].  DNS Dynamic Update operations have also been defined
  1000. +    [RFC2136], but without a detailed description of security for the
  1001. +    update operation.  This memo describes how to use DNSSEC digital
  1002. +    signatures covering requests and data to secure updates and restrict
  1003. +    updates to those authorized to perform them as indicated by the
  1004. +    updater's possession of cryptographic keys.
  1005. + Acknowledgements
  1006. +    The contributions of the following persons (who are listed in
  1007. +    alphabetic order) to this memo are gratefully acknowledged:
  1008. +          Olafur Gudmundsson (ogud@tis.com>
  1009. +          Charlie Kaufman <Charlie_Kaufman@iris.com>
  1010. +          Stuart Kwan <skwan@microsoft.com>
  1011. +          Edward Lewis <lewis@tis.com>
  1012. + Table of Contents
  1013. +       1. Introduction............................................2
  1014. +       1.1 Overview of DNS Dynamic Update.........................2
  1015. +       1.2 Overview of DNS Security...............................2
  1016. +       2. Two Basic Modes.........................................3
  1017. +       3. Keys....................................................5
  1018. +       3.1 Update Keys............................................6
  1019. +       3.1.1 Update Key Name Scope................................6
  1020. +       3.1.2 Update Key Class Scope...............................6
  1021. +       3.1.3 Update Key Signatory Field...........................6
  1022. + Eastlake                    Standards Track                     [Page 1]
  1023. + RFC 2137                         SDNSDU                       April 1997
  1024. +       3.2 Zone Keys and Update Modes.............................8
  1025. +       3.3 Wildcard Key Punch Through.............................9
  1026. +       4. Update Signatures.......................................9
  1027. +       4.1 Update Request Signatures..............................9
  1028. +       4.2 Update Data Signatures................................10
  1029. +       5. Security Considerations................................10
  1030. +       References................................................10
  1031. +       Author's Address..........................................11
  1032. + 1. Introduction
  1033. +    Dynamic update operations have been defined for the Domain Name
  1034. +    System (DNS) in RFC 2136, but without a detailed description of
  1035. +    security for those updates.  Means of securing the DNS and using it
  1036. +    for key distribution have been defined in RFC 2065.
  1037. +    This memo proposes techniques based on the defined DNS security
  1038. +    mechanisms to authenticate DNS updates.
  1039. +    Familiarity with the DNS system [RFC 1034, 1035] is assumed.
  1040. +    Familiarity with the DNS security and dynamic update proposals will
  1041. +    be helpful.
  1042. + 1.1 Overview of DNS Dynamic Update
  1043. +    DNS dynamic update defines a new DNS opcode, new DNS request and
  1044. +    response structure if that opcode is used, and new error codes.  An
  1045. +    update can specify complex combinations of deletion and insertion
  1046. +    (with or without pre-existence testing) of resource records (RRs)
  1047. +    with one or more owner names; however, all testing and changes for
  1048. +    any particular DNS update request are restricted to a single zone.
  1049. +    Updates occur at the primary server for a zone.
  1050. +    The primary server for a secure dynamic zone must increment the zone
  1051. +    SOA serial number when an update occurs or the next time the SOA is
  1052. +    retrieved if one or more updates have occurred since the previous SOA
  1053. +    retrieval and the updates themselves did not update the SOA.
  1054. + 1.2 Overview of DNS Security
  1055. +    DNS security authenticates data in the DNS by also storing digital
  1056. +    signatures in the DNS as SIG resource records (RRs).  A SIG RR
  1057. +    provides a digital signature on the set of all RRs with the same
  1058. +    owner name and class as the SIG and whose type is the type covered by
  1059. +    the SIG.  The SIG RR cryptographically binds the covered RR set to
  1060. +    the signer, time signed, signature expiration date, etc.  There are
  1061. +    one or more keys associated with every secure zone and all data in
  1062. +    the secure zone is signed either by a zone key or by a dynamic update
  1063. + Eastlake                    Standards Track                     [Page 2]
  1064. + RFC 2137                         SDNSDU                       April 1997
  1065. +    key tracing its authority to a zone key.
  1066. +    DNS security also defines transaction SIGs and request SIGs.
  1067. +    Transaction SIGs appear at the end of a response.  Transaction SIGs
  1068. +    authenticate the response and bind it to the corresponding request
  1069. +    with the key of the host where the responding DNS server is.  Request
  1070. +    SIGs appear at the end of a request and authenticate the request with
  1071. +    the key of the submitting entity.
  1072. +    Request SIGs are the primary means of authenticating update requests.
  1073. +    DNS security also permits the storage of public keys in the DNS via
  1074. +    KEY RRs.  These KEY RRs are also, of course, authenticated by SIG
  1075. +    RRs.  KEY RRs for zones are stored in their superzone and subzone
  1076. +    servers, if any, so that the secure DNS tree of zones can be
  1077. +    traversed by a security aware resolver.
  1078. + 2. Two Basic Modes
  1079. +    A dynamic secure zone is any secure DNS zone containing one or more
  1080. +    KEY RRs that can authorize dynamic updates, i.e., entity or user KEY
  1081. +    RRs with the signatory field non-zero, and whose zone KEY RR
  1082. +    signatory field indicates that updates are implemented. There are two
  1083. +    basic modes of dynamic secure zone which relate to the update
  1084. +    strategy, mode A and mode B.  A summary comparison table is given
  1085. +    below and then each mode is described.
  1086. + Eastlake                    Standards Track                     [Page 3]
  1087. + RFC 2137                         SDNSDU                       April 1997
  1088. +                    SUMMARY OF DYNAMIC SECURE ZONE MODES
  1089. +    CRITERIA:                |   MODE A           |   MODE B
  1090. +    =========================+====================+===================
  1091. +    Definition:              | Zone Key Off line  | Zone Key On line
  1092. +    =========================+====================+===================
  1093. +    Server Workload          |   Low              |   High
  1094. +    -------------------------+--------------------+-------------------
  1095. +    Static Data Security     |   Very High        |   Medium-High
  1096. +    -------------------------+--------------------+-------------------
  1097. +    Dynamic Data Security    |   Medium           |   Medium-High
  1098. +    -------------------------+--------------------+-------------------
  1099. +    Key Restrictions         |   Fine grain       |   Coarse grain
  1100. +    -------------------------+--------------------+-------------------
  1101. +    Dynamic Data Temporality |   Transient        |   Permanent
  1102. +    -------------------------+--------------------+-------------------
  1103. +    Dynamic Key Rollover     |   No               |   Yes
  1104. +    -------------------------+--------------------+-------------------
  1105. +    For mode A, the zone owner key and static zone master file are always
  1106. +    kept off-line for maximum security of the static zone contents.
  1107. +    As a consequence, any dynamicly added or changed RRs are signed in
  1108. +    the secure zone by their authorizing dynamic update key and they are
  1109. +    backed up, along with this SIG RR, in a separate online dynamic
  1110. +    master file.  In this type of zone, server computation is minimized
  1111. +    since the server need only check signatures on the update data and
  1112. +    request, which have already been signed by the updater, generally a
  1113. +    much faster operation than signing data.  However, the AXFR SIG and
  1114. +    NXT RRs which covers the zone under the zone key will not cover
  1115. +    dynamically added data.  Thus, for type A dynamic secure zones, zone
  1116. +    transfer security is not automatically provided for dynamically added
  1117. +    RRs, where they could be omitted, and authentication is not provided
  1118. +    for the server denial of the existence of a dynamically added type.
  1119. +    Because the dynamicly added RRs retain their update KEY signed SIG,
  1120. +    finer grained control of updates can be implemented via bits in the
  1121. +    KEY RR signatory field.  Because dynamic data is only stored in the
  1122. +    online dynamic master file and only authenticated by dynamic keys
  1123. +    which expire, updates are transient in nature.  Key rollover for an
  1124. +    entity that can authorize dynamic updates is more cumbersome since
  1125. +    the authority of their key must be traceable to a zone key and so, in
  1126. +    general, they must securely communicate a new key to the zone
  1127. +    authority for manual transfer to the off line static master file.
  1128. +    NOTE: for this mode the zone SOA must be signed by a dynamic update
  1129. +    key and that private key must be kept on line so that the SOA can be
  1130. +    changed for updates.
  1131. + Eastlake                    Standards Track                     [Page 4]
  1132. + RFC 2137                         SDNSDU                       April 1997
  1133. +    For mode B, the zone owner key and master file are kept on-line at
  1134. +    the zone primary server. When authenticated updates succeed, SIGs
  1135. +    under the zone key for the resulting data (including the possible NXT
  1136. +    type bit map changes) are calculated and these SIG (and possible NXT)
  1137. +    changes are entered into the zone and the unified on-line master
  1138. +    file.  (The zone transfer AXFR SIG may be recalculated for each
  1139. +    update or on demand when a zone transfer is requested and it is out
  1140. +    of date.)
  1141. +    As a consequence, this mode requires considerably more computational
  1142. +    effort on the part of the server as the public/private keys are
  1143. +    generally arranged so that signing (calculating a SIG) is more effort
  1144. +    than verifying a signature.  The security of static data in the zone
  1145. +    is decreased because the ultimate state of the static data being
  1146. +    served and the ultimate zone authority private key are all on-line on
  1147. +    the net.  This means that if the primary server is subverted, false
  1148. +    data could be authenticated to secondaries and other
  1149. +    servers/resolvers.  On the other hand, this mode of operation means
  1150. +    that data added dynamically is more secure than in mode A.  Dynamic
  1151. +    data will be covered by the AXFR SIG and thus always protected during
  1152. +    zone transfers and will be included in NXT RRs so that it can be
  1153. +    falsely denied by a server only to the same extent that static data
  1154. +    can (i.e., if it is within a wild card scope). Because the zone key
  1155. +    is used to sign all the zone data, the information as to who
  1156. +    originated the current state of dynamic RR sets is lost, making
  1157. +    unavailable the effects of some of the update control bits in the KEY
  1158. +    RR signatory field.  In addition, the incorporation of the updates
  1159. +    into the primary master file and their authentication by the zone key
  1160. +    makes then permanent in nature.  Maintaining the zone key on-line
  1161. +    also means that dynamic update keys which are signed by the zone key
  1162. +    can be dynamically updated since the zone key is available to
  1163. +    dynamically sign new values.
  1164. +    NOTE:  The Mode A / Mode B distinction only effects the validation
  1165. +    and performance of update requests.  It has no effect on retrievals.
  1166. +    One reasonable operational scheme may be to keep a mostly static main
  1167. +    zone operating in Mode A and have one or more dynamic subzones
  1168. +    operating in Mode B.
  1169. + 3. Keys
  1170. +    Dynamic update requests depend on update keys as described in section
  1171. +    3.1 below.  In addition, the zone secure dynamic update mode and
  1172. +    availability of some options is indicated in the zone key.  Finally,
  1173. +    a special rule is used in searching for KEYs to validate updates as
  1174. +    described in section 3.3.
  1175. + Eastlake                    Standards Track                     [Page 5]
  1176. + RFC 2137                         SDNSDU                       April 1997
  1177. + 3.1 Update Keys
  1178. +    All update requests to a secure zone must include signatures by one
  1179. +    or more key(s) that together can authorize that update.  In order for
  1180. +    the Domain Name System (DNS) server receiving the request to confirm
  1181. +    this, the key or keys must be available to and authenticated by that
  1182. +    server as a specially flagged KEY Resource Record.
  1183. +    The scope of authority of such keys is indicated by their KEY RR
  1184. +    owner name, class, and signatory field flags as described below. In
  1185. +    addition, such KEY RRs must be entity or user keys and not have the
  1186. +    authentication use prohibited bit on.  All parts of the actual update
  1187. +    must be within the scope of at least one of the keys used for a
  1188. +    request SIG on the update request as described in section 4.
  1189. + 3.1.1 Update Key Name Scope
  1190. +    The owner name of any update authorizing KEY RR must (1) be the same
  1191. +    as the owner name of any RRs being added or deleted or (2) a wildcard
  1192. +    name including within its extended scope (see section 3.3) the name
  1193. +    of any RRs being added or deleted and those RRs must be in the same
  1194. +    zone.
  1195. + 3.1.2 Update Key Class Scope
  1196. +    The class of any update authorizing KEY RR must be the same as the
  1197. +    class of any RR's being added or deleted.
  1198. + 3.1.3 Update Key Signatory Field
  1199. +    The four bit "signatory field" (see RFC 2065) of any update
  1200. +    authorizing KEY RR must be non-zero.  The bits have the meanings
  1201. +    described below for non-zone keys (see section 3.2 for zone type
  1202. +    keys).
  1203. +                     UPDATE KEY RR SIGNATORY FIELD BITS
  1204. +          0           1           2           3
  1205. +    +-----------+-----------+-----------+-----------+
  1206. +    |   zone    |  strong   |  unique   |  general  |
  1207. +    +-----------+-----------+-----------+-----------+
  1208. +    Bit 0, zone control - If nonzero, this key is authorized to attach,
  1209. +         detach, and move zones by creating and deleting NS, glue A, and
  1210. +         zone KEY RR(s).  If zero, the key can not authorize any update
  1211. +         that would effect such RRs.  This bit is meaningful for both
  1212. +         type A and type B dynamic secure zones.
  1213. + Eastlake                    Standards Track                     [Page 6]
  1214. + RFC 2137                         SDNSDU                       April 1997
  1215. +         NOTE:  do not confuse the "zone" signatory field bit with the
  1216. +         "zone" key type bit.
  1217. +    Bit 1, strong update - If nonzero, this key is authorized to add and
  1218. +         delete RRs even if there are other RRs with the same owner name
  1219. +         and class that are authenticated by a SIG signed with a
  1220. +         different dynamic update KEY. If zero, the key can only
  1221. +         authorize updates where any existing RRs of the same owner and
  1222. +         class are authenticated by a SIG using the same key.  This bit
  1223. +         is meaningful only for type A dynamic zones and is ignored in
  1224. +         type B dynamic zones.
  1225. +         Keeping this bit zero on multiple KEY RRs with the same or
  1226. +         nested wild card owner names permits multiple entities to exist
  1227. +         that can create and delete names but can not effect RRs with
  1228. +         different owner names from any they created.  In effect, this
  1229. +         creates two levels of dynamic update key, strong and weak, where
  1230. +         weak keys are limited in interfering with each other but a
  1231. +         strong key can interfere with any weak keys or other strong
  1232. +         keys.
  1233. +    Bit 2, unique name update - If nonzero, this key is authorized to add
  1234. +         and update RRs for only a single owner name.  If there already
  1235. +         exist RRs with one or more names signed by this key, they may be
  1236. +         updated but no new name created until the number of existing
  1237. +         names is reduced to zero.  This bit is meaningful only for mode
  1238. +         A dynamic zones and is ignored in mode B dynamic zones. This bit
  1239. +         is meaningful only if the owner name is a wildcard.  (Any
  1240. +         dynamic update KEY with a non-wildcard name is, in effect, a
  1241. +         unique name update key.)
  1242. +         This bit can be used to restrict a KEY from flooding a zone with
  1243. +         new names.  In conjunction with a local administratively imposed
  1244. +         limit on the number of dynamic RRs with a particular name, it
  1245. +         can completely restrict a KEY from flooding a zone with RRs.
  1246. +    Bit 3, general update - The general update signatory field bit has no
  1247. +         special meaning.  If the other three bits are all zero, it must
  1248. +         be one so that the field is non-zero to designate that the key
  1249. +         is an update key.  The meaning of all values of the signatory
  1250. +         field with the general bit and one or more other signatory field
  1251. +         bits on is reserved.
  1252. +    All the signatory bit update authorizations described above only
  1253. +    apply if the update is within the name and class scope as per
  1254. +    sections 3.1.1 and 3.1.2.
  1255. + Eastlake                    Standards Track                     [Page 7]
  1256. + RFC 2137                         SDNSDU                       April 1997
  1257. + 3.2 Zone Keys and Update Modes
  1258. +    Zone type keys are automatically authorized to sign anything in their
  1259. +    zone, of course, regardless of the value of their signatory field.
  1260. +    For zone keys, the signatory field bits have different means than
  1261. +    they they do for update keys, as shown below.  The signatory field
  1262. +    MUST be zero if dynamic update is not supported for a zone and MUST
  1263. +    be non-zero if it is.
  1264. +                      ZONE KEY RR SIGNATORY FIELD BITS
  1265. +                   0           1           2           3
  1266. +             +-----------+-----------+-----------+-----------+
  1267. +             |   mode    |  strong   |  unique   |  general  |
  1268. +             +-----------+-----------+-----------+-----------+
  1269. +    Bit 0, mode - This bit indicates the update mode for this zone.  Zero
  1270. +         indicates mode A while a one indicates mode B.
  1271. +    Bit 1, strong update - If nonzero, this indicates that the "strong"
  1272. +         key feature described in section 3.1.3 above is implemented and
  1273. +         enabled for this secure zone.  If zero, the feature is not
  1274. +         available.  Has no effect if the zone is a mode B secure update
  1275. +         zone.
  1276. +    Bit 2, unique name update - If nonzero, this indicates that the
  1277. +         "unique name" feature described in section 3.1.3 above is
  1278. +         implemented and enabled for this secure zone.  If zero, this
  1279. +         feature is not available.  Has no effect if the zone is a mode B
  1280. +         secure update zone.
  1281. +    Bit 3, general - This bit has no special meeting.  If dynamic update
  1282. +         for a zone is supported and the other bits in the zone key
  1283. +         signatory field are zero, it must be a one.  The meaning of zone
  1284. +         keys where the signatory field has the general bit and one or
  1285. +         more other bits on is reserved.
  1286. +    If there are multiple dynamic update KEY RRs for a zone and zone
  1287. +    policy is in transition, they might have different non-zero signatory
  1288. +    fields.  In that case, strong and unique name restrictions must be
  1289. +    enforced as long as there is a non-expired zone key being advertised
  1290. +    that indicates mode A with the strong or unique name bit on
  1291. +    respectively.  Mode B updates MUST be supported as long as there is a
  1292. +    non-expired zone key that indicates mode B.  Mode A updates may be
  1293. +    treated as mode B updates at server option if non-expired zone keys
  1294. +    indicate that both are supported.
  1295. + Eastlake                    Standards Track                     [Page 8]
  1296. + RFC 2137                         SDNSDU                       April 1997
  1297. +    A server that will be executing update operations on a zone, that is,
  1298. +    the primary master server, MUST not advertize a zone key that will
  1299. +    attract requests for a mode or features that it can not support.
  1300. + 3.3 Wildcard Key Punch Through
  1301. +    Just as a zone key is valid throughout the entire zone, update keys
  1302. +    with wildcard names are valid throughout their extended scope, within
  1303. +    the zone. That is, they remain valid for any name that would match
  1304. +    them, even existing specific names within their apparent scope.
  1305. +    If this were not so, then whenever a name within a wildcard scope was
  1306. +    created by dynamic update, it would be necessary to first create a
  1307. +    copy of the KEY RR with this name, because otherwise the existence of
  1308. +    the more specific name would hide the authorizing KEY RR and would
  1309. +    make later updates impossible.  An updater could create such a KEY RR
  1310. +    but could not zone sign it with their authorizing signer.  They would
  1311. +    have to sign it with the same key using the wildcard name as signer.
  1312. +    Thus in creating, for example, one hundred type A RRs authorized by a
  1313. +    *.1.1.1.in-addr.arpa. KEY RR, without key punch through 100 As, 100
  1314. +    KEYs, and 200 SIGs would have to be created as opposed to merely 100
  1315. +    As and 100 SIGs with key punch through.
  1316. + 4. Update Signatures
  1317. +    Two kinds of signatures can appear in updates.  Request signatures,
  1318. +    which are always required, cover the entire request and authenticate
  1319. +    the DNS header, including opcode, counts, etc., as well as the data.
  1320. +    Data signatures, on the other hand, appear only among the RRs to be
  1321. +    added and are only required for mode A operation.  These two types of
  1322. +    signatures are described further below.
  1323. + 4.1 Update Request Signatures
  1324. +    An update can effect multiple owner names in a zone.  It may be that
  1325. +    these different names are covered by different dynamic update keys.
  1326. +    For every owner name effected, the updater must know a private key
  1327. +    valid for that name (and the zone's class) and must prove this by
  1328. +    appending request SIG RRs under each such key.
  1329. +    As specified in RFC 2065, a request signature is a SIG RR occurring
  1330. +    at the end of a request with a type covered field of zero.  For an
  1331. +    update, request signatures occur in the Additional information
  1332. +    section.  Each request SIG signs the entire request, including DNS
  1333. +    header, but excluding any other request SIG(s) and with the ARCOUNT
  1334. +    in the DNS header set to what it wold be without the request SIGs.
  1335. + Eastlake                    Standards Track                     [Page 9]
  1336. + RFC 2137                         SDNSDU                       April 1997
  1337. + 4.2 Update Data Signatures
  1338. +    Mode A dynamic secure zones require that the update requester provide
  1339. +    SIG RRs that will authenticate the after update state of all RR sets
  1340. +    that are changed by the update and are non-empty after the update.
  1341. +    These SIG RRs appear in the request as RRs to be added and the
  1342. +    request must delete any previous data SIG RRs that are invalidated by
  1343. +    the request.
  1344. +    In Mode B dynamic secure zones, all zone data is authenticated by
  1345. +    zone key SIG RRs.  In this case, data signatures need not be included
  1346. +    with the update.  A resolver can determine which mode an updatable
  1347. +    secure zone is using by examining the signatory field bits of the
  1348. +    zone KEY RR (see section 3.2).
  1349. + 5. Security Considerations
  1350. +    Any zone permitting dynamic updates is inherently less secure than a
  1351. +    static secure zone maintained off line as recommended in RFC 2065. If
  1352. +    nothing else, secure dynamic update requires on line change to and
  1353. +    re-signing of the zone SOA resource record (RR) to increase the SOA
  1354. +    serial number.  This means that compromise of the primary server host
  1355. +    could lead to arbitrary serial number changes.
  1356. +    Isolation of dynamic RRs to separate zones from those holding most
  1357. +    static RRs can limit the damage that could occur from breach of a
  1358. +    dynamic zone's security.
  1359. + References
  1360. +    [RFC2065] Eastlake, D., and C. Kaufman, "Domain Name System Security
  1361. +    Extensions", RFC 2065, CyberCash, Iris, January 1997.
  1362. +    [RFC2136] Vixie, P., Editor, Thomson, T., Rekhter, Y., and J. Bound,
  1363. +    "Dynamic Updates in the Domain Name System (DNS UPDATE)", RFC 2136,
  1364. +    April 1997.
  1365. +    [RFC1035] Mockapetris, P., "Domain Names - Implementation and
  1366. +    Specifications", STD 13, RFC 1035, November 1987.
  1367. +    [RFC1034] Mockapetris, P., "Domain Names - Concepts and Facilities",
  1368. +    STD 13, RFC 1034, November 1987.
  1369. + Eastlake                    Standards Track                    [Page 10]
  1370. + RFC 2137                         SDNSDU                       April 1997
  1371. + Author's Address
  1372. +    Donald E. Eastlake, 3rd
  1373. +    CyberCash, Inc.
  1374. +    318 Acton Street
  1375. +    Carlisle, MA 01741 USA
  1376. +    Phone:   +1 508-287-4877
  1377. +             +1 508-371-7148 (fax)
  1378. +             +1 703-620-4200 (main office, Reston, Virginia, USA)
  1379. +    EMail:   dee@cybercash.com
  1380. + Eastlake                    Standards Track                    [Page 11]
  1381. Index: bind/src/CHANGES
  1382. diff -c bind/src/CHANGES:8.9 bind/src/CHANGES:8.10
  1383. *** bind/src/CHANGES:8.9    Mon Apr 28 12:16:19 1997
  1384. --- bind/src/CHANGES    Wed Apr 30 15:38:10 1997
  1385. ***************
  1386. *** 1,4 ****
  1387. --- 1,18 ----
  1388.   
  1389. +     --- 8.1-T5B released ---
  1390. +  182.    [bug]        fix the way bindname is allocated in hesiod_to_bind().
  1391. +  181.    [bug]        MAXHOSTNAMELEN wasn't defined on Solaris.
  1392. +  180.    [bug]        a check for zptr != NULL in res_update was wrong.  It
  1393. +             should have been zptr == NULL.
  1394. +  179.    [bug]        sq_remove() and sq_done() were calling ns_freexfr()
  1395. +             when any stream was removed, resulting in a panic
  1396. +             when the server was reloaded.  ns_freexfr() is now
  1397. +             only called when a zone transfer stream is removed.
  1398.       --- 8.1-T4B released ---
  1399.   
  1400.    178.    [bug]        if the server was reloaded and then a zone was
  1401. Index: bind/src/README
  1402. diff -c bind/src/README:8.14 bind/src/README:8.15
  1403. *** bind/src/README:8.14    Fri Apr 25 22:59:02 1997
  1404. --- bind/src/README    Wed Apr 30 15:38:10 1997
  1405. ***************
  1406. *** 1,4 ****
  1407. ! This is the source portion of BIND version 8.1-T4B.  Its companions are
  1408.   "doc" and "contrib" so you are probably not missing anything.
  1409.   
  1410.   BIND 8 Features
  1411. --- 1,4 ----
  1412. ! This is the source portion of BIND version 8.1-T5B.  Its companions are
  1413.   "doc" and "contrib" so you are probably not missing anything.
  1414.   
  1415.   BIND 8 Features
  1416. Index: bind/src/Version
  1417. diff -c bind/src/Version:8.5 bind/src/Version:8.6
  1418. *** bind/src/Version:8.5    Thu Apr 24 18:31:39 1997
  1419. --- bind/src/Version    Wed Apr 30 15:38:11 1997
  1420. ***************
  1421. *** 1 ****
  1422. ! 8.1-T4B
  1423. --- 1 ----
  1424. ! 8.1-T5B
  1425. Index: bind/src/bin/named/ns_defs.h
  1426. diff -c bind/src/bin/named/ns_defs.h:8.30 bind/src/bin/named/ns_defs.h:8.31
  1427. *** bind/src/bin/named/ns_defs.h:8.30    Thu Apr 24 16:02:27 1997
  1428. --- bind/src/bin/named/ns_defs.h    Wed Apr 30 15:40:21 1997
  1429. ***************
  1430. *** 1,6 ****
  1431.   /*
  1432.    *    from ns.h    4.33 (Berkeley) 8/23/90
  1433. !  *    $Id: ns_defs.h,v 8.30 1997/04/24 23:02:27 vixie Exp $
  1434.    */
  1435.   
  1436.   /*
  1437. --- 1,6 ----
  1438.   /*
  1439.    *    from ns.h    4.33 (Berkeley) 8/23/90
  1440. !  *    $Id: ns_defs.h,v 8.31 1997/04/30 22:40:21 halley Exp $
  1441.    */
  1442.   
  1443.   /*
  1444. ***************
  1445. *** 456,461 ****
  1446. --- 456,462 ----
  1447.   #define STREAM_READ_EV        0x04
  1448.   #define STREAM_CONNECT_EV    0x08
  1449.   #define STREAM_DONE_CLOSE    0x10
  1450. + #define STREAM_AXFR        0x20
  1451.   
  1452.   struct netinfo {
  1453.       struct netinfo    *next;
  1454. Index: bind/src/bin/named/ns_main.c
  1455. diff -c bind/src/bin/named/ns_main.c:8.49 bind/src/bin/named/ns_main.c:8.50
  1456. *** bind/src/bin/named/ns_main.c:8.49    Thu Apr 24 18:31:45 1997
  1457. --- bind/src/bin/named/ns_main.c    Wed Apr 30 15:40:22 1997
  1458. ***************
  1459. *** 1,6 ****
  1460.   #if !defined(lint) && !defined(SABER)
  1461.   static char sccsid[] = "@(#)ns_main.c    4.55 (Berkeley) 7/1/91";
  1462. ! static char rcsid[] = "$Id: ns_main.c,v 8.49 1997/04/25 01:31:45 vixie Exp $";
  1463.   #endif /* not lint */
  1464.   
  1465.   /*
  1466. --- 1,6 ----
  1467.   #if !defined(lint) && !defined(SABER)
  1468.   static char sccsid[] = "@(#)ns_main.c    4.55 (Berkeley) 7/1/91";
  1469. ! static char rcsid[] = "$Id: ns_main.c,v 8.50 1997/04/30 22:40:22 halley Exp $";
  1470.   #endif /* not lint */
  1471.   
  1472.   /*
  1473. ***************
  1474. *** 1291,1297 ****
  1475.           INSIST_ERR(evDeselectFD(ev, qp->evID_w) != -1);
  1476.       if (qp->flags & STREAM_CONNECT_EV)
  1477.           INSIST_ERR(evCancelConn(ev, qp->evID_c) != -1);
  1478. !     ns_freexfr(qp);
  1479.       (void) close(qp->s_rfd);
  1480.       if (qp == streamq)
  1481.           streamq = qp->s_next;
  1482. --- 1291,1298 ----
  1483.           INSIST_ERR(evDeselectFD(ev, qp->evID_w) != -1);
  1484.       if (qp->flags & STREAM_CONNECT_EV)
  1485.           INSIST_ERR(evCancelConn(ev, qp->evID_c) != -1);
  1486. !     if (qp->flags & STREAM_AXFR)
  1487. !         ns_freexfr(qp);
  1488.       (void) close(qp->s_rfd);
  1489.       if (qp == streamq)
  1490.           streamq = qp->s_next;
  1491. ***************
  1492. *** 1510,1516 ****
  1493.           free(sp->s_wbuf);
  1494.           sp->s_wbuf = NULL;
  1495.       }
  1496. !     ns_freexfr(sp);
  1497.       sp->s_refcnt = 0;
  1498.       sp->s_time = tt.tv_sec;
  1499.       if (sp->flags & STREAM_DONE_CLOSE) {
  1500. --- 1511,1518 ----
  1501.           free(sp->s_wbuf);
  1502.           sp->s_wbuf = NULL;
  1503.       }
  1504. !     if (sp->flags & STREAM_AXFR)
  1505. !         ns_freexfr(sp);
  1506.       sp->s_refcnt = 0;
  1507.       sp->s_time = tt.tv_sec;
  1508.       if (sp->flags & STREAM_DONE_CLOSE) {
  1509. Index: bind/src/bin/named/ns_xfr.c
  1510. diff -c bind/src/bin/named/ns_xfr.c:8.16 bind/src/bin/named/ns_xfr.c:8.17
  1511. *** bind/src/bin/named/ns_xfr.c:8.16    Thu Apr 24 16:58:51 1997
  1512. --- bind/src/bin/named/ns_xfr.c    Wed Apr 30 15:40:22 1997
  1513. ***************
  1514. *** 1,5 ****
  1515.   #if !defined(lint) && !defined(SABER)
  1516. ! static char rcsid[] = "$Id: ns_xfr.c,v 8.16 1997/04/24 23:58:51 vixie Exp $";
  1517.   #endif /* not lint */
  1518.   
  1519.   /*
  1520. --- 1,5 ----
  1521.   #if !defined(lint) && !defined(SABER)
  1522. ! static char rcsid[] = "$Id: ns_xfr.c,v 8.17 1997/04/30 22:40:22 halley Exp $";
  1523.   #endif /* not lint */
  1524.   
  1525.   /*
  1526. ***************
  1527. *** 103,108 ****
  1528. --- 103,109 ----
  1529.                 (char *)&sndlowat, sizeof sndlowat);
  1530.   #endif
  1531.       zones[zone].z_numxfrs++;
  1532. +     qsp->flags |= STREAM_AXFR;
  1533.       if (sq_openw(qsp, 64*1024) == -1)
  1534.           goto abort;
  1535.       memset(&qsp->xfr, 0, sizeof qsp->xfr);
  1536. ***************
  1537. *** 165,170 ****
  1538. --- 166,172 ----
  1539.       while (qsp->xfr.lev)
  1540.           qsp->xfr.lev = sx_freelev(qsp->xfr.lev);
  1541.       zones[qsp->xfr.zone].z_numxfrs--;
  1542. +     qsp->flags &= ~STREAM_AXFR;
  1543.   }
  1544.   
  1545.   /* u_char *
  1546. Index: bind/src/lib/irs/hesiod.c
  1547. diff -c bind/src/lib/irs/hesiod.c:1.13 bind/src/lib/irs/hesiod.c:1.14
  1548. *** bind/src/lib/irs/hesiod.c:1.13    Thu Apr 24 15:34:14 1997
  1549. --- bind/src/lib/irs/hesiod.c    Wed Apr 30 15:39:02 1997
  1550. ***************
  1551. *** 1,5 ****
  1552.   #if defined(LIBC_SCCS) && !defined(lint)
  1553. ! static const char rcsid[] = "$Id: hesiod.c,v 1.13 1997/04/24 22:34:14 vixie Exp $";
  1554.   #endif
  1555.   
  1556.   /*
  1557. --- 1,5 ----
  1558.   #if defined(LIBC_SCCS) && !defined(lint)
  1559. ! static const char rcsid[] = "$Id: hesiod.c,v 1.14 1997/04/30 22:39:02 halley Exp $";
  1560.   #endif
  1561.   
  1562.   /*
  1563. ***************
  1564. *** 164,187 ****
  1565.   char *
  1566.   hesiod_to_bind(void *context, const char *name, const char *type) {
  1567.       struct hesiod_p *ctx = (struct hesiod_p *) context;
  1568. !     char bindname[MAXDNAME], *cp, *ret;
  1569.       char **rhs_list = NULL;
  1570. !     const char *RHS;
  1571. !     
  1572. !     strcpy(bindname, name);
  1573. !     if ((cp = strchr(bindname, '@')) != NULL) {
  1574. !         *cp++ = '\0';
  1575. !         if (strchr(cp, '.'))
  1576. !             RHS = name + (cp - bindname);
  1577. !         else if (NULL != (rhs_list = hesiod_resolve(context, cp,
  1578. !                                 "rhs-extension")))
  1579.               RHS = *rhs_list;
  1580.           else {
  1581.               errno = ENOENT;
  1582.               return (NULL);
  1583.           }
  1584. !     } else
  1585.           RHS = ctx->RHS;
  1586.       strcat(bindname, ".");
  1587.       strcat(bindname, type);
  1588.       if (ctx->LHS) {
  1589. --- 164,204 ----
  1590.   char *
  1591.   hesiod_to_bind(void *context, const char *name, const char *type) {
  1592.       struct hesiod_p *ctx = (struct hesiod_p *) context;
  1593. !     char *bindname;
  1594.       char **rhs_list = NULL;
  1595. !     const char *RHS, *cp;
  1596. !     /* Decide what our RHS is, and set cp to the end of the actual name. */
  1597. !     if ((cp = strchr(name, '@')) != NULL) {
  1598. !         if (strchr(cp + 1, '.'))
  1599. !             RHS = cp + 1;
  1600. !         else if ((rhs_list = hesiod_resolve(context, cp + 1,
  1601. !             "rhs-extension")) != NULL)
  1602.               RHS = *rhs_list;
  1603.           else {
  1604.               errno = ENOENT;
  1605.               return (NULL);
  1606.           }
  1607. !     } else {
  1608.           RHS = ctx->RHS;
  1609. +         cp = name + strlen(name);
  1610. +     }
  1611. +     /*
  1612. +      * Allocate the space we need, including up to three periods and
  1613. +      * the terminating NUL.
  1614. +      */
  1615. +     if ((bindname = malloc((cp - name) + strlen(type) + strlen(RHS) +
  1616. +         (ctx->LHS ? strlen(ctx->LHS) : 0) + 4)) == NULL) {
  1617. +         errno = ENOMEM;
  1618. +         if (rhs_list)
  1619. +             hesiod_free_list(context, rhs_list);
  1620. +         return NULL;
  1621. +     }
  1622. +     /* Now put together the DNS name. */
  1623. +     memcpy(bindname, name, cp - name);
  1624. +     bindname[cp - name] = '\0';
  1625.       strcat(bindname, ".");
  1626.       strcat(bindname, type);
  1627.       if (ctx->LHS) {
  1628. ***************
  1629. *** 190,206 ****
  1630.           strcat(bindname, ctx->LHS);
  1631.       }
  1632.       if (RHS[0] != '.')
  1633. !         strcat(bindname,".");
  1634.       strcat(bindname, RHS);
  1635.       if (rhs_list)
  1636.           hesiod_free_list(context, rhs_list);
  1637. !     ret = malloc(strlen(bindname) + 1);
  1638. !     if (!ret) {
  1639. !         errno = ENOMEM;
  1640. !         return (NULL);
  1641. !     }
  1642. !     strcpy(ret, bindname);
  1643. !     return (ret);
  1644.   }
  1645.   
  1646.   /*
  1647. --- 207,219 ----
  1648.           strcat(bindname, ctx->LHS);
  1649.       }
  1650.       if (RHS[0] != '.')
  1651. !         strcat(bindname, ".");
  1652.       strcat(bindname, RHS);
  1653.       if (rhs_list)
  1654.           hesiod_free_list(context, rhs_list);
  1655. !     return (bindname);
  1656.   }
  1657.   
  1658.   /*
  1659. Index: bind/src/lib/resolv/res_update.c
  1660. diff -c bind/src/lib/resolv/res_update.c:1.10 bind/src/lib/resolv/res_update.c:1.11
  1661. *** bind/src/lib/resolv/res_update.c:1.10    Fri Apr 25 21:01:35 1997
  1662. --- bind/src/lib/resolv/res_update.c    Wed Apr 30 15:39:33 1997
  1663. ***************
  1664. *** 1,5 ****
  1665.   #if !defined(lint) && !defined(SABER)
  1666. ! static char rcsid[] = "$Id: res_update.c,v 1.10 1997/04/26 04:01:35 vixie Exp $";
  1667.   #endif /* not lint */
  1668.   
  1669.   /*
  1670. --- 1,5 ----
  1671.   #if !defined(lint) && !defined(SABER)
  1672. ! static char rcsid[] = "$Id: res_update.c,v 1.11 1997/04/30 22:39:33 halley Exp $";
  1673.   #endif /* not lint */
  1674.   
  1675.   /*
  1676. ***************
  1677. *** 320,326 ****
  1678.                   if (strcasecmp(zname, zptr->z_origin) == 0)
  1679.                   break;
  1680.               }
  1681. !             if (zptr != NULL)
  1682.                   /* should not happen */
  1683.                   return (-1);
  1684.               if (nscount > 0) {
  1685. --- 320,326 ----
  1686.                   if (strcasecmp(zname, zptr->z_origin) == 0)
  1687.                   break;
  1688.               }
  1689. !             if (zptr == NULL)
  1690.                   /* should not happen */
  1691.                   return (-1);
  1692.               if (nscount > 0) {
  1693. Index: bind/src/port/solaris/include/port_after.h
  1694. diff -c bind/src/port/solaris/include/port_after.h:1.5 bind/src/port/solaris/include/port_after.h:1.6
  1695. *** bind/src/port/solaris/include/port_after.h:1.5    Mon Feb 10 15:04:20 1997
  1696. --- bind/src/port/solaris/include/port_after.h    Wed Apr 30 15:41:40 1997
  1697. ***************
  1698. *** 50,52 ****
  1699. --- 50,60 ----
  1700.   
  1701.   #define NEED_DAEMON
  1702.   int daemon(int nochdir, int noclose);
  1703. + /*
  1704. +  * Solaris defines this in <netdb.h> instead of in <sys/param.h>.  We don't
  1705. +  * define it in our <netdb.h>, so we define it here.
  1706. +  */
  1707. + #ifndef MAXHOSTNAMELEN
  1708. + #define MAXHOSTNAMELEN 256
  1709. + #endif
  1710.